package com.iteaj.network.test.server.line.protocol;

import com.iteaj.network.ProtocolType;
import com.iteaj.network.server.protocol.ServerInitiativeProtocol;
import com.iteaj.network.test.TestProtocolType;
import com.iteaj.network.test.message.line.LineMessage;
import com.iteaj.network.test.message.line.LineMessageBody;
import com.iteaj.network.test.message.line.LineMessageHead;

import java.io.IOException;

public class LineServerInitiativeProtocol extends ServerInitiativeProtocol<LineMessage> {

    private String equipCode;

    public LineServerInitiativeProtocol(String equipCode) {
        this.equipCode = equipCode;
    }

    @Override
    protected LineMessage doBuildRequestMessage() throws IOException {
        return new LineMessage(LineMessageHead.build(this.equipCode
                , this.equipCode, protocolType()), LineMessageBody.build());
    }

    @Override
    protected void doBuildResponseMessage(LineMessage message) {

    }

    @Override
    public ProtocolType protocolType() {
        return TestProtocolType.PIReq;
    }
}
